/**
 * Created by lvlq on 16/1/7.
 */
var shell = require("./shellController");
var model = require("./modelController");
var wsdl = require("./wsdlController");
var admin = require("./adminController");
var home = require("./homeController");

module.exports = function (app) {
    app.get("/*", function (req, res, next) {
        res.locals.share = {
            link: "http://shellrev.weixinzjit.com/index/shell",
            img: "http://shellrev.weixinzjit.com/images/share.jpg",
            desc: "壳牌劲霸焕新有礼 大奖等你拿",
            title: "我正在参与壳牌劲霸“新装上市，好礼相送”活动，豪礼不错过，你也来参与吧！"
        };
        next();
    });
    app.get("/shell", shell.index);
    app.get("/shell/*", function (req, res, next) {
        res.locals.share.title = "我正在参与壳牌劲霸“幸运有你大转盘”活动，豪礼不错过，你也来参与吧！";
        next();
    });

    app.get("/shell/more", shell.more);
    app.get("/shell/once", shell.once);
    app.get("/shell/share", shell.share);
    app.get("/shell/lucky", shell.lucky);
    app.get("/shell/fight/*", function (req, res, next) {
        res.locals.share.title = "我正在参与壳牌劲霸“拼颜值100%赢豪礼”活动，豪礼不错过，你也来参与吧！";
        next();
    });
    app.get("/shell/fight/desc", shell.fightdesc);
    app.get("/shell/fight/upload", shell.fightupload);
    app.get("/shell/fight/qccode", shell.fightqccode);
    app.get("/shell/fight/rolutte", shell.fightrolutte);
    app.get("/shell/fight/share", shell.fightshare);

    app.get("/shell/home", home.index);

    app.post("/shell/prize", shell.prize);
    app.post("/shell/update/address", shell.updateAddress);
    app.post("/shell/fight/checkcode", shell.checkcode);


    //app.get("/model", model.index);
    //app.get("/model/init/activelist", model.initActivelist);
    //app.get("/model/init/prizelist", model.initPrizelist);
    //app.get("/model/init/userlist", model.initUserlist);
    //app.get("/model/init/imagelist", model.initImagelist);
    app.get("/model/init/wsdl", model.initWsdl);

    app.post("/wsdl/getaccode", wsdl.Get_AcCodeInterface);

    app.get("/duang", admin.index);
    app.get("/duang/export", admin.exportCSV);

};